<?php

/*
Process Delete Club (admin_delete_club.pro.php)
*/

$rank_check = "7";
include "../global.inc.php";

$club_owner = stripspaces(strtolower($club_owner));
$getOwner = fetch("SELECT id FROM members2 WHERE username = '$club_owner' AND game = '$game'");
$getclub = fetch("SELECT id FROM clubs2 WHERE owner = '$getOwner[id]' AND game = '$game'");

if (!$getclub[id])
{
	die(header(error("admin_delete_club.php?game=$game", "That club does not exsist.")));
}
else
{
	mysql_query("DELETE FROM clubs2 WHERE owner = '$getUser[id]' AND game = '$game'");
	mysql_query("DELETE FROM club_members2 WHERE club = '$getclub[id]' AND game = '$game'");
	mysql_query("DELETE FROM club_forums2 WHERE club = '$getclub[id]' AND game = '$game'");
	mysql_query("DELETE FROM club_pages2 WHERE club = '$getclub[id]' AND game = '$game'");
	
	die(header(error("admin_delete_club.php?game=$game", "$getclub[name] owned by $getUser[username] has been deleted.")));
}

?>
